/**
 * Copyright (c) 2002-2011 旭鸣信息
 * All rights reserved. 
 * File：CouponRuleService.java
 * History:
 *       Apr 16, 2012: Initially created, liuzhi.
 */
package com.xteam.ecsystem.service.admin;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.xteam.ecsystem.dao.ICouponRuleDao;

/**
 * 购物券规则业务管理层
 * @author liuzhi
 *
 */
@Service
public class CouponRuleService {
	
	@Autowired
	private ICouponRuleDao bcrDao;
	
	/**
	 * 
	 * 新增或者修改购物券规则信息
	 * @author liuzhi
	 * @param obj
	 * @param id
	 */
	public void saveOrUpdateObject(Object obj, String id){
		this.bcrDao.saveOrUpdateObject(obj, id);
	}
	
	/**
	 * 
	 * 条件查询和分页显示购物券规则信息
	 * @author liuzhi
	 * @param index
	 * @param size
	 * @return
	 */
	public String getCouponRuleList(int pageIndex, int pageSize){
		return this.bcrDao.getCouponRuleList(pageIndex, pageSize);
	}

	/**
	 * 
	 * 删除单条或多条购物券规则信息
	 * @author liuzhi
	 * @param ids
	 */
	public void delObject(String ids){
		this.bcrDao.delObject(ids);
	}
	
	/**
	 * 根据购物券规则编号获得对应的购物券规则信息
	 * @author liuzhi
	 * @param id
	 * @return
	 */
	public String getCouponRuleById(String id){
		return this.bcrDao.getCouponRuleById(id);
	}
	
	/**
	 * 
	 * 根据购物券规则编号修改购物券规则状态
	 * 0：无效
	 * 1：有效
	 * @author liuzhi
	 * @param id
	 */
	public void updateCouponRuleStateById(String id){
		this.bcrDao.updateCouponRuleStateById(id);
	}
	
}
